package cn.anecansaitin.firecrafting.client.event;

import cn.anecansaitin.firecrafting.ModConstant;
import cn.anecansaitin.firecrafting.common.block.ModBlocks;
import net.minecraft.client.renderer.ItemBlockRenderTypes;
import net.minecraft.client.renderer.RenderType;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;

//方块渲染相关事件
@Mod.EventBusSubscriber(modid = ModConstant.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public class BlockRenderEvent {
    //修改方块渲染类型
    @SubscribeEvent
    public static void type(FMLClientSetupEvent event) {
        event.enqueueWork(() -> {
            //将所有火焰的方块渲染改为translucent
            ItemBlockRenderTypes.setRenderLayer(ModBlocks.ENDER_FIRE.get(), RenderType.cutoutMipped());
            ItemBlockRenderTypes.setRenderLayer(ModBlocks.COMPANION_FIRE.get(), RenderType.cutoutMipped());
            ItemBlockRenderTypes.setRenderLayer(ModBlocks.DRAGON_BREATH_FIRE.get(), RenderType.cutoutMipped());
            ItemBlockRenderTypes.setRenderLayer(ModBlocks.HEAVEN_FIRE.get(), RenderType.cutoutMipped());
            ItemBlockRenderTypes.setRenderLayer(ModBlocks.HELL_FIRE.get(), RenderType.cutoutMipped());
            ItemBlockRenderTypes.setRenderLayer(ModBlocks.MAGIC_FIRE.get(), RenderType.cutoutMipped());
            ItemBlockRenderTypes.setRenderLayer(ModBlocks.THREE_MEIS_TRUE_FIRE.get(), RenderType.cutoutMipped());
            ItemBlockRenderTypes.setRenderLayer(ModBlocks.RAINBOW_FIRE.get(), RenderType.cutoutMipped());
        });
    }
}
